package com.daykw.wenshu.task;

import java.util.Random;
import java.util.concurrent.ExecutorService;

import javax.annotation.PostConstruct;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.daykw.wenshu.utils.ThreadPools;

public abstract class CustmTask implements Job {


	protected Random random = new Random();

	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		this.doWork();
	}

	@PostConstruct
	public void init() {
		System.out.println("############Cust Task start###############");
		this.doStart();
	}

	public abstract void doStart();

	public abstract void doWork();

	public ExecutorService getPool(int THREAD_SIZE) {
		return ThreadPools.getThreadPool(this, THREAD_SIZE + 1);
	}

}
